package main

import (
	"fmt"
	"math/rand"
	"time"
)

func guess() {

	// 使用当前时间作为随机数生成器的种子
	rand.Seed(time.Now().UnixNano())
	// 生成1到100的随机整数
	var randomNumber = rand.Intn(100) + 1
	var guessNumber int
	var count int
	fmt.Println("答案是：", randomNumber)
	for {
		fmt.Println("请猜一个数字，范围1-100：")
		fmt.Scanln(&guessNumber)

		// 次数加一
		count++

		if (count == 1) && (guessNumber == randomNumber) {
			fmt.Println("你真是个天才")
			break
		} else if (count == 2 || count == 3) && (guessNumber == randomNumber) {
			fmt.Println("你很聪明，赶上我了")
			break
		} else if (count >= 4 && count <= 9) && (guessNumber == randomNumber) {
			fmt.Println("一般般")
			break
		} else if (count == 10) && (guessNumber == randomNumber) {
			fmt.Println("可算猜对啦")
			break
		} else if (count > 10) && (guessNumber != randomNumber) {
			fmt.Println("说你点啥好呢")
			break
		}

	}

}

func main() {
	guess()
}
